<template>
    <van-skeleton title :row="3" v-if="gj" />
    <div v-else>
        <div v-html="xq.goods_introduce"></div>
        
    </div>
    <!-- 轮播图 -->

    <van-action-bar>
        <van-action-bar-icon icon="chat-o" text="客服" color="#ee0a24" />
        <van-action-bar-icon icon="cart-o" text="购物车" />
        <van-action-bar-icon icon="star" text="已收藏" color="#ff5000" />
        <van-action-bar-button type="warning" text="加入购物车" @click="jr" />
        <van-action-bar-button type="danger" text="立即购买" />
    </van-action-bar>
</template>

<script setup>
import { detailAppi } from '@/api/api';
import { useRoute } from 'vue-router';
let route = useRoute();
import { ref } from 'vue';
let xq = ref([]);
detailAppi(route.params.goods_id).then(res => {
    console.log("详情", res);
    xq.value = res.data.message

})

import { useRouter } from 'vue-router';

let router = useRouter();

let jr = () => {
    router.push('/index/cart')
}

let gj = ref(true);
setTimeout(() => {
    gj.value = false
}, 1000)

// 轮播图
 const images = [
      'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
      'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
      'https://fastly.jsdelivr.net/npm/@vant/assets/apple-3.jpeg',
      'https://fastly.jsdelivr.net/npm/@vant/assets/apple-4.jpeg',
    ];
</script>

<style lang="scss" scoped></style>